<template>
  <div>
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>材料使用
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="$router.go(0)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe662;</span>刷新
          </el-button>
        </div>
      </div>
    </div>

    <div class="component-searchHeader">
      <div class="search-header">
        <div class="left-title">
          <p class="left-text">
            <span class="iconfont" style="font-weight:700">&#xe63d;</span>筛选查询
          </p>
          <div class="right">
            <button>查询</button>
          </div>
        </div>
      </div>
    </div>

    <div class="component-search-box">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="输入搜索：">
          <el-input v-model="formInline.search" placeholder="材料名称"></el-input>
        </el-form-item>
        <el-form-item label="材料类型：">
          <el-select v-model="formInline.select" placeholder="全部">
            <el-option label="光纤电缆" value="gq"></el-option>
            <el-option label="光纤电缆" value="dl"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="供方：">
          <el-select v-model="formInline.supply" placeholder="全部">
            <el-option label="甲方供料" value="ll"></el-option>
            <el-option label="自购材料" value="tl"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label=" 领料人： ">
          <el-input v-model="formInline.name" placeholder="负责人姓名"></el-input>
        </el-form-item>
        <el-form-item label="使用类型：">
          <el-select v-model="formInline.kinds" placeholder="全部">
            <el-option label="领料" value="ll"></el-option>
            <el-option label="退料" value="tl"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </div>

    <div class="component-listHeader">
      <div class="search-header">
        <div class="left-title">
          <p class="left-text">
            <span class="iconfont">&#xe61e;</span>
            材料使用
          </p>
          <div class="right">
            <el-select v-model="value1" placeholder="显示条数" class="right-select-margin">
              <el-option
                v-for="item in options1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
            <el-select v-model="value2" placeholder="排序方式" class="right-select-margin">
              <el-option
                v-for="item in options2"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </div>
        </div>
      </div>
    </div>

    <div class="table">
      <el-table
        ref="multipleTable"
        :data="info"
        tooltip-effect="dark"
        style="width: 100%;"
        border
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" align="center" width="55"></el-table-column>
        <el-table-column label="编号" align="center" width="80" prop="nickname"></el-table-column>
        <el-table-column label="材料名称" align="center" prop="nickname"></el-table-column>
        <el-table-column label="材料类型" align="center" width="100" prop="nickname"></el-table-column>
        <el-table-column label="使用数量" align="center" width="100" prop="nickname"></el-table-column>
        <el-table-column label="负责人" align="center" width="80" prop="nickname"></el-table-column>
        <el-table-column label="出库数量" align="center" width="80" prop="nickname"></el-table-column>
        <el-table-column label="剩余数量" align="center" width="80" prop="nickname"></el-table-column>
        <el-table-column label="供方" align="center" width="100" prop="nickname"></el-table-column>
        <el-table-column label="使用类型" align="center" width="100" prop="nickname"></el-table-column>
        <el-table-column label="操作信息" width="100" align="center">
          <template slot-scope="scope">
            <el-button
              @click="handleDelete(scope.$index, scope.row)"
              type="text"
              size="small"
              class="red"
            >删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="component-paging" v-if="info.length > 1">
      <div class="table-bottom">
        <div class="bottom-left"></div>
        <div class="paging">
          <div class="paging-left">
            <p>
              共
              <span>{{total/pageSize}}</span> 页/
              <span>{{total}}</span> 条数据
            </p>
          </div>
          <el-pagination
            background
            @size-change="SizeChange"
            @current-change="CurrentChange"
            :current-page="currentPage"
            :page-sizes="[10, 20, 30]"
            :page-size="pageSize"
            layout="sizes, prev, pager, next, jumper"
            :total="total"
          ></el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        search: "",
        select: "",
        supply: "",
        name: "",
        kinds: ""
      },
      // 显示条数的data
      options1: [
        {
          value: "选项1",
          label: "1"
        }
      ],
      // 排序方式的data
      options2: [
        {
          value: "选项1",
          label: "a"
        }
      ],
      // 显示条数的v-model
      value1: "",
      // 排序方式的v-model
      value2: "",
      info: [
        {
          nickname: "zm"
        },
        {
          nickname: "zms"
        }
      ], //表格内容
      form: {
        name: "",
        tel: "",
        details: "",
        area_details: ""
      },
      multipleSelection: [], //多选
      // 数据总条数
      total: 500,
      // 每页显示数据的条数
      pageSize: 10,
      // 当前显示的页面页码
      currentPage: 1
    };
  },
  methods: {
    //全选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    //删除
    handleDelete() {}
  }
};
</script>

<style scoped>

.component-searchHeader .search-header {
  width: 1100px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.component-searchHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-searchHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  text-align: left;
  margin: 0 0 0 30px;
}

.component-searchHeader .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 30px;
}

.component-searchHeader .right button {
  padding: 0 25px;
  height: 30px;
  margin: 8px 5px;
  line-height: 30px;
  font-size: 14px;
  color: #666;
  background-color: #fff;
  border: 1px solid #ccc;
}

.component-searchHeader .right button:hover {
  background-color: #f3f3f3;
}
.component-search-box {
  width: 1100px;
  box-sizing: border-box;
  background-color: #fff;
  border: 1px solid #e4e4e4;
  border-top: none;
  margin: 0 auto;
  text-align: left;
  padding-left: 30px;
  line-height: 60px;
  padding-bottom: 15px;
  padding-top: 15px;
}
.component-search-box .el-input__inner {
  height: 35px;
  display: inline-block;
}
.el-form-item {
  margin-bottom: 0;
}
.component-listHeader .search-header {
  width: 1100px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  border-bottom: none;
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.component-listHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-listHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  text-align: left;
  margin: 0 0 0 30px;
}

.component-listHeader .search-header .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 10px;
}

.component-listHeader .search-header .right button {
  padding: 0 15px;
  height: 30px;
  width: 80px;
  margin: 6px 5px;
  line-height: 30px;
  font-size: 14px;
  color: #666;
  background-color: #fff;
  border: 1px solid #ccc;
}
.el-form-item {
  text-align: right;
  width: 310px;
}
.component-listHeader .search-header .right button:hover {
  background-color: #f3f3f3;
}
.component-listHeader .search-header .right .right-select-margin {
  margin-top: 8px;
  margin-right: 8px;
}
/* 删除按钮 */
.red {
  color: #48c9b0;
  font-size: 12px;
}

.table {
  width: 1100px;
  margin: 0 auto;
}
</style>
